{include file="header.html"}

<div class="page-header">
	<h6>
		套餐管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			套餐编辑
		</small>
	</h6>
</div><!-- /.page-header -->
<div class="row">
<div class="col-xs-12">
	<form class="form-horizontal" role="form" method="post" action="?app=meal&act=save" enctype="multipart/form-data">
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="id"> ID </label>
			<div class="col-sm-10">
				<input type="text" id="id" name="id" readonly="" value="{$row->id}" class="col-xs-1" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="name"> 套餐名称 </label>
			<div class="col-sm-10">
				<input type="text" id="name" name="name" value="{$row->name}" class="col-xs-6" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="type_id"> 关联项目 </label>
			<div class="col-sm-2">
				<select name="project_id" id="project_id" class=" selectpicker" data-live-search="true">
					<option value="">关联项目</option>
					{foreach from=$projects name=project item=project}
					<option value="{$project->id}" {if $row->project_id=={$project->id}}selected{/if}>{$project->name}</option>
					{/foreach}
				</select> 		
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right"> 列表图片 </label>
			<div class="col-sm-10">
				<table><tr><td>
						<input type="hidden" name="origin_list_pic" value="{$row->list_pic}" /> 
						<input type="file" name="list_pic" value="" /> 
					</td>
					<td>
					{if $row->list_pic}<img src="{$row->list_pic}" width="100" />{/if}
					</td>
				</tr></table>	
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right"> 详情图片 </label>
			<div class="col-sm-10">
				<table><tr><td>
						<input type="hidden" name="origin_detail_pic" value="{$row->detail_pic}" /> 
						<input type="file" name="detail_pic" value="" /> 
					</td>
					<td>
					{if $row->detail_pic}<img src="{$row->detail_pic}" width="100" />{/if}
					</td>
				</tr></table>	
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="price"> 价格 </label>
			<div class="col-sm-10">
				<input type="text" id="price" name="price" value="{$row->price}" class="col-xs-2" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="num"> 套餐次数 </label>
			<div class="col-sm-10">
				<input type="text" id="num" name="num" value="{$row->num}" class="col-xs-2" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="market_price"> 市场价 </label>
			<div class="col-sm-10">
				<input type="text" id="market_price" name="market_price" value="{$row->market_price}" class="col-xs-2" />
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="description"> 套餐介绍 </label>
			<div class="col-sm-10">
				<textarea class="form-control" id="description" name="description" rows="5">{$row->description}</textarea>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="status"> 状态 </label>
			<div class="col-sm-10">
				<div class="radio">
					<label>
						<input {if $row->status==1}checked{/if} value="1" name="status" type="radio" class="ace" />
						<span class="lbl"> 正常</span>
					</label>
				</div>
				<div class="radio">
					<label>
						<input {if $row->status==0}checked{/if} value="0" name="status" type="radio" class="ace" />
						<span class="lbl"> 隐藏 </span>
					</label>
				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label no-padding-right" for="sort"> 排序 </label>
			<div class="col-sm-10">
				<input type="text" id="sort" name="sort" value="{$row->sort}" class="col-xs-2" />
			</div>
		</div>

		<div class="clearfix form-actions">
			<div class="col-md-offset-3 col-md-9">
				<button class="btn btn-info" type="submit">
					<i class="ace-icon fa fa-check bigger-110"></i>
					提交
				</button>

				&nbsp; &nbsp; &nbsp;
				<button class="btn" type="reset">
					<i class="ace-icon fa fa-undo bigger-110"></i>
					重置
				</button>
			</div>
		</div>
	</form>
</div>
</div>

{include file="footer.html"}
<script>

	$(window).on('load', function () {

            $('.selectpicker').selectpicker({
                'selectedTexselectpickert': 'cat'
            });

            // $('.selectpicker').selectpicker('hide');
        });

</script>